# Maintainer: Luca Weiss <luca@z3ntu.xyz>
# Contributor: Brandon Boese <brandonboese@protonmail.com>
pkgname=u1db-qt
pkgver=0.1.7
pkgrel=0
pkgdesc="Simple Qt5 binding and QtQuick2 plugin for U1DB"
url="https://gitlab.com/ubports/development/core/u1db-qt"
arch="all"
license="GPL-3.0-only"
makedepends="
	cmake
	samurai
	qt5-qtdeclarative-dev
	"
checkdepends="
	dbus-test-runner
	"
source="https://gitlab.com/ubports/development/core/u1db-qt/-/archive/$pkgver/u1db-qt-$pkgver.tar.gz
	0001-point-qmlplugindump-to-qmlplugindump-qt5.patch
	0002-point-qmltestrunner-to-qmltestrunner-qt5.patch
	"
options="!check" # requires a display

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
bd64c0f48e8a078c9393948d41e06eb13b337e6b5fa965cd01e2a854495b6fac1aa6567871d3f781952190c22a834f5fcc4f012499ef8374d0b985c21f57db0f  u1db-qt-0.1.7.tar.gz
69ae5a296e43d5429a4e32deaa777015d2ec2c8ca8a4946d6da36dd4aa934345f41e2449d16360a3f8ac061acf2e9f9b91c8ee777e849f399ec4818c10e39f17  0001-point-qmlplugindump-to-qmlplugindump-qt5.patch
f57ec76224aab9600c2d0bbcd596231c1fe92f24475eba295b0bbbcc301df9f57695d9f2e3ed65f678f1e888081a782fa8789a5f721a1cb3d6cbe7f894ba86da  0002-point-qmltestrunner-to-qmltestrunner-qt5.patch
"
